package client

import scala.actors._
import assignments._

case class ClientWorker (id : Int) extends ReplyReactor {
  
  var status : Int = 0;

  def act()
  {
    loop
    {
      react
      {
        case task : ProjectTask =>
          println("Worker (" + id + "): Recieved and processing project task #" + task.id)
          sender ! ProjectResult(task.id, task.run())
          println("Worker (" + id + "): Finished project task #" + task.id)
        case Idle =>
          println("Worker (" + id + "): Sitting Idle")
      }
    }
  }

}